//
//  YZNetworkManager+changeMobileNumber.m
//  YZMicroStock
//
//  Created by apple on 17/3/7.
//  Copyright © 2017年 cqjr. All rights reserved.
//

#import "YZClient+changeMobileNumber.h"

@implementation YZNetworkManager (changeMobileNumber)

-(void)unbind_getMobileImessagewithCheckCode:(NSString *)code success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    NSDictionary *params = @{@"checkCode":code, @"device": @"3"};
    [self.mainNetwork cq_noCachePOST:URL_FOR_UNBIND_IMESSAGE_CHANGEMOBILE parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
        if (success) {
            success(task, responseObject);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}

-(void)unbind_getMobileImessagesuccess:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *params = @{@"device": @"3"};
    [self.mainNetwork cq_noCachePOST:URL_FOR_UNBIND_IMESSAGE_CHANGEMOBILE parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
        if (success) {
            success(task, responseObject);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}


-(void)unbind_MobileWithCheckCode:(NSString *)code Success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *params = @{@"checkCode":code, @"device": @"3"};
    [self.mainNetwork cq_noCachePOST:URL_FOR_UNBIND_CHANGEMOBILE parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
        if (success) {
            success(task, responseObject);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}


-(void)bind_getMobileImessageWithMobile:(NSString *)mobile withCheckCode:(NSString *)code success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *params = @{COMMON_REQUEST_DEVICE:COMMON_REQUEST_DEVICE_VALUE, @"mobile":mobile, @"checkCode":code};
    [self.mainNetwork cq_noCachePOST:URL_FOR_BIND_IMESSAGE_NEWMOBILE parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
        if (success) {
            success(task, responseObject);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
    
}


-(void)bind_getMobileImessageWithMobile:(NSString *)mobile success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *params = @{COMMON_REQUEST_DEVICE:COMMON_REQUEST_DEVICE_VALUE, @"mobile":mobile};
    [self.mainNetwork cq_noCachePOST:URL_FOR_BIND_IMESSAGE_NEWMOBILE parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
        if (success) {
            success(task, responseObject);
        }
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        if (failure) {
            failure(error);
        }
    }];
}

- (void)bind_NewCheckMobileWithMobile:(NSString *)mobile withCheckCode:(NSString *)code success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *params = @{COMMON_REQUEST_DEVICE:COMMON_REQUEST_DEVICE_VALUE, @"mobile":mobile, @"checkCode":code};
    [self.mainNetwork cq_noCachePOST: URL_FOR_BIND_IMESSAGE_NEWMOBILE parameters: params
                             success:^(NSURLSessionDataTask *task, id responseObject) {
                                 if (success) {
                                     success(task, responseObject);
                                 }
                             } failure: ^(NSURLSessionDataTask *task, NSError *error) {
                                 if (failure) {
                                     failure(error);
                                 }
                             }];
}

-(void)bind_NewMobileWithMobile:(NSString *)mobile withCheckCode:(NSString *)code success:(void (^)(NSURLSessionDataTask *, id))success failure:(void (^)(NSError *))failure{
    
    NSDictionary *params = @{COMMON_REQUEST_DEVICE:COMMON_REQUEST_DEVICE_VALUE, @"mobile":mobile, @"checkCode":code};
    [self.mainNetwork cq_noCachePOST: URL_FOR_BIND_NEWMOBILE parameters: params
                             success:^(NSURLSessionDataTask *task, id responseObject) {
                                 if (success) {
                                     success(task, responseObject);
                                 }
                             } failure: ^(NSURLSessionDataTask *task, NSError *error) {
                                 if (failure) {
                                     failure(error);
                                 }
                             }];
}

@end
